from django.contrib import admin
from .models import *


# Register your models here.
@admin.register(Courses)
class CoursesAdmin(admin.ModelAdmin):
    # 要显示的字段
    list_display = ('CourseName',
                    'StudentID',
                    'Teacher',
                    'Class',
                    'ClassWeek',
                    'StartTime',
                    'EndTime',
                    'Week',
                    'room',
                    'Date')

    # 需要搜索的字段
    search_fields = ('CourseName', 'StudentID')

    # 分页显示，一页的数量
    list_per_page = 10

    actions_on_top = True


@admin.register(Events)
class CoursesAdmin(admin.ModelAdmin):
    # 要显示的字段
    list_display = ('EventsName',
                    'EventsID',
                    'StudentID',
                    'StartTime',
                    'EndTime',
                    'Week',
                    'Date')

    # 需要搜索的字段
    search_fields = ('EventsName', 'StudentID')

    # 分页显示，一页的数量
    list_per_page = 10

    actions_on_top = True


@admin.register(Meetings)
class CoursesAdmin(admin.ModelAdmin):
    # 要显示的字段
    list_display = ('MeetingName',
                    'MeetingID',
                    'StudentID',
                    'StartTime',
                    'EndTime',
                    'Week',
                    'Date')

    # 需要搜索的字段
    search_fields = ('MeetingName', 'StudentID')

    # 分页显示，一页的数量
    list_per_page = 10

    actions_on_top = True
